1 1 : <script type="text/javascript">
2 : function colapseContent(id) {
3 : if(document.getElementById(id).style.display == "none") {
4 : document.getElementById(id).style.display = "";
5 : }else {
6 : document.getElementById(id).style.display = "none";
7 : }
8 : }
9 : </script>
10 :
11 1 : <?php
12 :
13 : /*--------------------------------------------------------------------------+
14 : This file is part of eStudy.
15 : planspiel/classes/class.container.inc.php
16 : - Modulgruppe: Planspiel
17 : - Beschreibung: Template Container für das Planspiel Modul
18 : - Version: 0.9
19 : - Autor(en): Marcel Knapp <marcel.knapp@mni.fh-giessen.de>
20 : +---------------------------------------------------------------------------+
21 : This program is free software; you can redistribute it and/or
22 : modify it under the terms of the GNU General Public License
23 : as published by the Free Software Foundation; either version 2
24 : of the License, or any later version.
25 : +---------------------------------------------------------------------------+
26 : This program is distributed in the hope that it will be useful,
27 : but WITHOUT ANY WARRANTY; without even the implied warranty of
28 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 : GNU General Public License for more details.
30 : You should have received a copy of the GNU General Public License
31 : along with this program; if not, write to the Free Software
32 : Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 : +--------------------------------------------------------------------------*/
34 : /**
35 : * Template Container für das Planspiel Modul
36 : * @package eStudy.Planspiel
37 : * @version 0.9
38 : * @author Marcel Knapp <marcel.knapp@mni.fh-giessen.de>
39 : */
40 :
41 1 : class PlanspielContainer {
42 : // Private Members
43 : private $title;
44 : private $content;
45 : private $id;
46 : // Properties
47 : public $width = "90%";
48 :
49 : function PlanspielContainer($id, $title) {
50 : // Set private Members
51 0 : $this->title = $title;
52 0 : $this->id = $id;
53 0 : }
54 :
55 : public function show_start () {
56 : // Draw the Container
57 0 : $this->draw_start();
58 0 : }
59 : public function show_end(){
60 0 : $this->draw_end();
61 0 : }
62 : private function get_arrow() {
63 :
64 0 : $start_cells = 0;
65 0 : $count_cells = 11;
66 0 : $start_rows = 0;
67 0 : $count_rows = 6;
68 :
69 0 : ?><table border="0" cellspacing="0" cellpadding="0"><?
70 :
71 0 : for ($i = $start_rows; $i < $count_rows; $i++) {
72 0 : echo "<tr>";
73 0 : for ($n = $start_cells; $n < $count_cells; $n++) {
74 0 : if ($n >= $i && $n < ($count_cells-$i)) {
75 0 : ?><td nowrap="nowrap" style="width: 1px; height: 1px; background-color: #4E646E;"></td><?
76 0 : } else {
77 0 : ?><td nowrap="nowrap" style="width: 1px; height: 1px;"></td><?
78 : }
79 0 : }
80 0 : echo "</tr>";
81 0 : }
82 0 : echo "</table>";
83 0 : }
84 :
85 : private function draw_start () {
86 : ?>
87 0 : <table cellpadding="0" border="0" cellspacing="1" style="background-color: #B2C4E2; width: <?php echo $this->width; ?>;">
88 : <tr id="trHeader">
89 0 : <td style="width: 100%;" onclick="colapseContent('trContent<?php echo $this->id; ?>');">
90 : <table cellpadding="4" border="0" cellspacing="0" style="background-color: #BAD1DC; width: 100%;">
91 : <tr>
92 0 : <td style="text-align:left; color: #4E646E; font-size: 14px; font-weight: bold; font-family: Verdana,Tahoma,Arial;"><?php echo $this->title; ?></td>
93 : </tr>
94 : </table>
95 : </td>
96 0 : <td align="center" nowrap="nowrap" onclick="colapseContent('trContent<?php echo $this->id; ?>');" style="width: 25px; background-color: #CFE2EB; cursor: pointer; text-align:center;">
97 : <table border="0" cellpadding="0" cellspacing="0" style="width:100%;">
98 0 : <tr><td align="center"><?php echo $this->get_arrow(); ?></td></tr>
99 : </table>
100 : </td>
101 : </tr>
102 0 : <tr id="trContent<?php echo $this->id; ?>">
103 : <td colspan="2">
104 : <table cellpadding="4" border="0" cellspacing="0" style="background-color: #F2F5FA; width: 100%;">
105 : <tr>
106 : <td style="text-align: left; color: #5F6D84; font-size: 12px; font-family: Verdana,Tahoma,Arial; padding: 14px;">
107 0 : <?
108 0 : }
109 : function draw_end() {
110 : ?>
111 : </td>
112 : </tr>
113 : </table>
114 : </td>
115 : </tr>
116 : </table>
117 0 : <?
118 0 : }
119 : }
120 : ?>
|